
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
   <%@ page import="java.util.List, cl.ventas.modelo.Producto, cl.ventas.modelo.Usuario"%>

<jsp:useBean id="producto" class="cl.ventas.beans.ProductoBean" scope="request"></jsp:useBean>
<jsp:setProperty property="codigo" name="producto" />
<%
    Producto prod = producto.findById(); 
    Usuario u = (Usuario) request.getSession().getAttribute("usuario");
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
         <style type="text/css">
    <!--
    body {
    background-color: #FFFF99;
    }
body,td,th {
        //Hobo Std
    font-family: Arial, Helvetica, sans-serif;
    }

.Estilo1 {
    color: #FFFFFF;
    font-weight: bold;
    }
    .Estilo2{
        color:#FFFFCC;
        
        
    }
     #titulo{
        
    font-family: Hobo Std;
    
    }
</style>
    </head>
    <body>
<table align="center">
    <tr>
       <th id = "titulo" colspan="6" style="background-color: #CC9933" ><h2>
                    <a style="font-size: 40px"><font color="#FFFFFF">Bienvenido <%=u.getUsuario_nombre()%></a>
        </font></th>
    </tr>
    <tr>
        <th colspan="2">
            <a href="listado.htm">
                <img src="${pageContext.request.contextPath}/img/ListadoBtn.gif" width="220" height="50" alt="ListadoBtn"/>
            </a>
        </th>
        <th>
            <a href="AgregarCarrito1.htm">
                <img src="${pageContext.request.contextPath}/img/AgrCarrBtn.gif" width="220" height="50" alt="AgrCarrBtn"/>
            </a>

        </th>
        <th colspan="2">
            <a href="VerCarrito.htm">
                <img src="${pageContext.request.contextPath}/img/VerCarritoBtn.gif" width="150" height="50" alt="VerCarritoBtn"/>
            </a>
        </th>
        <th>
            <a href="salir.htm">
                <img src="${pageContext.request.contextPath}/img/SalirBtn.gif" width="100" height="50" alt="SalirBtn"/>
            </a>

            
        </th></tr></table>
        <br>
        <form action="AgregarCarrito3.htm" method="POST">
        <table align="center">
            <tr>
                <td><strong>Codigo</strong></td>
                <td><input type="text" name="codigo" value="<%=prod.getCodigo()%>" readonly="readonly" /></td>
            </tr>
            <tr>
                <td><strong>Producto</strong></td>
                <td><input type="text" name="producto" value="<%=prod.getNombre()%>" readonly="readonly" /></td>
            </tr>
            <tr>
                <td><strong>Stock</strong></td>
                <td><input type="text" name="stock" value="<%=(int) prod.getStock()%>" readonly="readonly" /></td>
            </tr>
            <tr>
                <td><strong>Cantidad Pedir</strong></td>
                <td>
                    <select name="cantidad">
                    <%for(int i = 0; i <= prod.getStock(); i++){ %>
                            <option><%=i%></option>
                    <%} %>
                    </select>
                </td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="Solicitar" name="Solicitar" />
                <input type="button" value="Volver" name="Volver" onclick="history.back()" /></td>
            </tr>
        </table><br>
                    <table border ="0" align = "center">
                
               <tr> <td width="50"><img src="${pageContext.request.contextPath}/img/tirado.gif" width="160" height="160" /></td></tr>
                
            </table>
        </form>
    </body>
</html>
